package com.hp.define
/**
 * Created by hp4664 on 2018/1/26.
 */
public class AppInfo {
    public static final Integer SUCCESS = 0
    public static final Integer ERROR_1_MAX_SIZE = 1
    public static final Integer ERROR_2_PERMISSION_DENIED = 2
    public static final Integer ERROR_3_FAILED_CREATE_FILE = 3
    public static final Integer ERROR_4_IO_ERROR = 4
    public static final Integer ERROR_5_NOT_MULTIPART_CONTENT = 5
    public static final Integer ERROR_6_PARSE_REQUEST_ERROR = 6
    public static final Integer ERROR_7_NOTFOUND_UPLOAD_DATA = 7
    public static final Integer ERROR_8_NOT_ALLOW_FILE_TYPE = 8
    public static final Integer ERROR_101_INVALID_ACTION = 101
    public static final Integer ERROR_102_CONFIG_ERROR = 102
    public static final Integer ERROR_201_PREVENT_HOST = 201
    public static final Integer ERROR_202_CONNECTION_ERROR = 202
    public static final Integer ERROR_203_REMOTE_FAIL = 203
    public static final Integer ERROR_301_NOT_DIRECTORY = 301
    public static final Integer ERROR_302_NOT_EXIST = 302
    public static final Integer ERROR_401_ILLEGAL = 401
    public static Map<Integer, String> info
    static {
        info = new HashMap<Integer, String>(){{
            put(SUCCESS, "SUCCESS")
            put(ERROR_1_MAX_SIZE, "文件大小超出限制")
            put(ERROR_2_PERMISSION_DENIED, "权限不足")
            put(ERROR_3_FAILED_CREATE_FILE, "创建文件失败")
            put(ERROR_4_IO_ERROR, "IO错误")
            put(ERROR_5_NOT_MULTIPART_CONTENT, "上传表单不是multipart/form-data类型")
            put(ERROR_6_PARSE_REQUEST_ERROR, "解析上传表单错误")
            put(ERROR_7_NOTFOUND_UPLOAD_DATA, "未找到上传数据")
            put(ERROR_8_NOT_ALLOW_FILE_TYPE, "不允许的文件类型")
            put(ERROR_101_INVALID_ACTION, "无效的Action")
            put(ERROR_102_CONFIG_ERROR, "配置文件初始化失败")
            put(ERROR_203_REMOTE_FAIL, "抓取远程图片失败")
            put(ERROR_201_PREVENT_HOST, "被阻止的远程主机")
            put(ERROR_202_CONNECTION_ERROR, "远程连接出错")
            put(ERROR_301_NOT_DIRECTORY, "指定路径不是目录")
            put(ERROR_302_NOT_EXIST, "指定路径并不存在")
            put(ERROR_401_ILLEGAL, "Callback参数名不合法")
        }}
    }

    public static String getStateInfo(Integer key) {
        return info.get(key)
    }
}
